From d0f28d825eafe00591d7b80b8de26e4fd783d924 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Sat, 24 May 2008 08:54:59 +0100 Subject: [PATCH] x86_emulate: Check single-step status at instruction start rather than end. This fixes booting of FreeDOS with HIMEM.SYS enabled. Signed-off-by: Trolle Selander Signed-off-by: Keir Fraser --- xen/arch/x86/x86_emulate/x86_emulate.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index bd318974c0..4c45ec0bce 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -2105,12 +2105,14 @@ x86_emulate( break; } + /* Inject #DB if single-step tracing was enabled at instruction start. */ + if ( (ctxt->regs->eflags & EFLG_TF) && (rc == X86EMUL_OKAY) && + (ops->inject_hw_exception != NULL) ) + rc = ops->inject_hw_exception(EXC_DB, -1, ctxt) ? : X86EMUL_EXCEPTION; + /* Commit shadow register state. */ _regs.eflags &= ~EFLG_RF; *ctxt->regs = _regs; - if ( (_regs.eflags & EFLG_TF) && (rc == X86EMUL_OKAY) && - (ops->inject_hw_exception != NULL) ) - rc = ops->inject_hw_exception(EXC_DB, -1, ctxt) ? : X86EMUL_EXCEPTION; done: return rc; -- 2.30.2